//
// Created by liushuai on 2020/1/31.
//
#include "twoSum.h"
vector<int> twoSum(vector<int>& nums, int target){
    int length = nums.size();
    vector<int> result;
    for(int i = 0;i<length;i++){

            result.push_back(i);
            for(int j=i+1;j<length;j++){
                if(nums.at(j) == target-nums.at(i)){
                    result.push_back(j);
                    return result;
                }
            }
            result.pop_back();
        }

    return result;
}
